<html>
<head>
</head>
<body>
<div id="d">Some text</div>
<script>
    var a = "<div>a DIV</div><script>alert('alert');<\/script>";
    document.getElementById("d").innerHTML = a;
</script>
</body>
</html>